package com.whp.yky.yky.controller;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.whp.yky.yky.entity.DataLog;
import com.whp.yky.yky.entity.poentity.Datas;
import com.whp.yky.yky.response.ResponseData;
import com.whp.yky.yky.service.impl.DataLogServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author zwq
 * @since 2021-03-02
 */
@RestController
@CrossOrigin
public class DataLogController {

    @Autowired
    private DataLogServiceImpl dataLogService;

    @PostMapping("/getDataLogInfo")
    public ResponseData getDataLogInfo(@RequestBody DataLog dataLog, @RequestParam Integer pageNum, @RequestParam Integer pageSize){

        ResponseData res = new ResponseData();


        res.setCode(20000);
        IPage<DataLog> pageList = this.dataLogService.getDataLogInfo(new Page((long)pageNum, (long)pageSize),dataLog);
        res.setData(pageList);
//        res.setTotal(dataServiceImpl.getDataInfo(datas).size());


        return res;
    }


}

